博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
合并脚本和样式表_将脚本和样式供稿添加到您的网站
阅读量:2511 次
发布时间:2019-05-11

本文共 2650 字,大约阅读时间需要 8 分钟。

合并脚本和样式表

is a website created by myself and where bloggers and developers alike submit articles about CSS, XHTML, jQuery, MooTools, and other website design and development topics. The site's popularity continues to grow due the community's enthusiasm and number of quality articles submitted on a daily basis.

是一个由我本人和创建的网站,博客作者和开发人员都提交有关CSS,XHTML,jQuery,MooTools以及其他网站设计和开发主题的文章。 由于社区的热情和每天提交的高质量文章的数量,该网站的受欢迎程度持续增长。

I love to share knowledge on my website and the first thing I did when we got the site going was get the feed on my site so that I could share links to other quality articles. The process took only 5 minutes. Here's how you can add the Script & Style feed to your website!

我喜欢在我的网站上分享知识,而当我们开始运行该网站时,我要做的第一件事就是在我的网站上获取供稿,以便我可以共享其他高质量文章的链接。 该过程仅花费了5分钟。 您可以通过以下方法将脚本和样式供稿添加到您的网站!

步骤1:下载SimplePie (Step 1: Download SimplePie)

is an outstanding feed reading PHP library which we'll use to grab, read, and cache the Script & Style feed. to hit the SimplePie download page.

是一个出色的feed阅读PHP库,我们将使用它来抓取,读取和缓存Script&Style feed。 访问SimplePie下载页面。

步骤2:PHP代码 (Step 2: The PHP Code)

//get teh simplepie libraryrequire_once('simplepie/simplepie.inc');//grab the feed$feed = new SimplePie('http://feeds.feedburner.com/ScriptAndStyle');//enable caching$feed->enable_cache(true);//provide the caching folder$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'].'/cache');//set the amount of seconds you want to cache the feed$feed->set_cache_duration(1800);//init the process$feed->init();//let simplepie handle the content type (atom, RSS...)$feed->handle_content_type();//load my own array -- i like my own arrays...for ($x = 0; $x < $feed->get_item_quantity(15); $x++) { $items[] = $feed->get_item($x); }//loop through each itemforeach ($items as $item){	echo '',$item->get_title(),'';}
David Walsh Script & Style feed

Once you have SimplePie available, pull in the Script & Style feed. You'll note that you want to enable caching and provide a caching folder to keep your site efficient. Once you've gotten each item into an $items array, you simply output the XHTML which you will eventually script and style. You can see examples on my site, , and Chris Coyier's website, .

提供SimplePie后,请插入“脚本和样式”提要。 您会注意到,您想要启用缓存并提供一个缓存文件夹以保持站点高效。 将每个项目放入$ items数组后,只需输出XHTML,您将最终编写脚本和样式。 您可以在我的网站和Chris Coyier的网站上看到示例。

就这样! (That's All!)

Adding the Script & Style feed to your website is a piece of cake! Well, thanks to SimplePie, it's a piece of pie. Have fun styling your Script & Style site feed. Post a link to your website when you're done -- we'd love to see what you've created!

将脚本和样式供稿添加到您的网站真是小菜一碟! 好吧,这要归功于SimplePie。 有趣的样式您的脚本和样式的站点提要。 完成后,将链接发布到您的网站-我们很乐意看到您创建的内容!

翻译自:

合并脚本和样式表

转载地址:http://rdpwd.baihongyu.com/

你可能感兴趣的文章
flask源码解读05: Context(AppContext, RequestContext)
查看>>
css实现弹出层显示阻止滚动条滚动
查看>>
ping IP 带时间戳循环显示并写入日志(windos版+linux版)
查看>>
自学MVC看这里——全网最全ASP.NET MVC 教程汇总
查看>>
mediaxyz访谈录:ffmpeg的码率控制
查看>>
CenTOS7使用ACL控制目录权限,只给某个用户访问特定目录
查看>>
七天入门统计力学-第2天 系综与配分函数
查看>>
ubuntu server 10.04 apache2配置多个虚拟主机
查看>>
python标准库xml.etree.ElementTree的bug
查看>>
Tomcat服务器介绍和使用
查看>>
IOS网络方面(异步请求)
查看>>
day6 python学习
查看>>
事务分类
查看>>
《程序是怎样跑起来的》第四章读后感
查看>>
遍历datatable的几种方法(C# )
查看>>
Oracle记录(三) Scott用户的表结构
查看>>
centos静默式安装Oracle11g
查看>>
软件评测师下午题笔记
查看>>
性能测试的概念
查看>>
JavaScript中的函数上下文和apply,call
查看>>